﻿using System;
using System.Configuration;
using System.IO;

namespace Sustainalytics.ESGComputing.Launcher
{
    class Program
    {
        static void Main(string[] args)
        {
            if (Environment.UserInteractive)
            {
                // start as console app
                ProgramConsole.Start(args);
            }
            else
            {
                var childProcessPath = ConfigurationManager.AppSettings["ChildProcessPath"];
                string cmd = Path.Combine(Utils.GetCurrentAssemblyDir(), childProcessPath);
                // start as windows service
                ProgramWindowsService.Start(cmd);
            }
        }
    }
}
